/*
 * Copyright 2010 J Patrick Davenport
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package v4view.web;

public class Caption extends ChildbearingWithInterfaces {
	private static final String	CAPTION_TEXT_KEY	= "captionText";
	private static final String	CAPTION_TAG			= "caption";

	{
		this.setTag(CAPTION_TAG);
		this.setSupportsAttributes(true);
	}

	public Caption() {
	}

	public Caption(final String _text) {
		this.addPageElement(new Content(_text).setElementId(CAPTION_TEXT_KEY));
	}

	/**
	 * Only adds _element if it is a Content or IInlineElement. All other adds are ignored.
	 */
	@Override
	public Caption addPageElement(final PageElement _element) {
		if (_element instanceof IInlineElement || _element instanceof Content) {
			super.addPageElement(_element);
		}

		return this;
	}

	@Override
	public Caption setCssClass(final String _value) {
		return (Caption) super.setCssClass(_value);
	}

	@Override
	public Caption setId(final String _value) {
		return (Caption) super.setId(_value);
	}

	@Override
	public Caption setStyle(final String _value) {
		return (Caption) super.setStyle(_value);
	}

	@Override
	public Caption setTitle(final String _value) {
		return (Caption) super.setTitle(_value);
	}

	@Override
	public Caption setOnKeyDown(final String _scriptlet) {
		return (Caption) super.setOnKeyDown(_scriptlet);
	}

	@Override
	public Caption setOnKeyPress(final String _scriptlet) {
		return (Caption) super.setOnKeyPress(_scriptlet);
	}

	@Override
	public Caption setOnKeyUp(final String _scriptlet) {
		return (Caption) super.setOnKeyUp(_scriptlet);
	}

	@Override
	public Caption setDir(final String _value) {
		return (Caption) super.setDir(_value);
	}

	@Override
	public Caption setLang(final String _lang) {
		return (Caption) super.setLang(_lang);
	}

	@Override
	public Caption setXmlLang(final String _xmlLang) {
		return (Caption) super.setXmlLang(_xmlLang);
	}

	@Override
	public Caption setOnClick(final String _scriptlet) {
		return (Caption) super.setOnClick(_scriptlet);
	}

	@Override
	public Caption setOnDblClick(final String _scriptlet) {
		return (Caption) super.setOnDblClick(_scriptlet);
	}

	@Override
	public Caption setOnMouseDown(final String _scriptlet) {
		return (Caption) super.setOnMouseDown(_scriptlet);
	}

	@Override
	public Caption setOnMouseMove(final String _scriptlet) {
		return (Caption) super.setOnMouseMove(_scriptlet);
	}

	@Override
	public Caption setMouseOut(final String _scriptlet) {
		return (Caption) super.setMouseOut(_scriptlet);
	}

	@Override
	public Caption setMouseOver(final String _scriptlet) {
		return (Caption) super.setMouseOver(_scriptlet);
	}

	@Override
	public Caption setMouseUp(final String _scriptlet) {
		return (Caption) super.setMouseUp(_scriptlet);
	}

	@Override
	public Caption setParent(final IParentElement _parent) {
		return (Caption) super.setParent(_parent);
	}
}
